#include<iostream>
#include<cstdio>
using namespace std;
int n,cnt,r;
// CJY AK IOI & I love CHS
int a[1000005];
int main(){
	freopen("fruit.in","r",stdin);
	freopen("fruit.out","w",stdout);
	cin>>n;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	while(cnt<n){
		r=-1;
		for(int i=1;i<=n;i++)
			if(a[i]!=r&&a[i]!=-1) cout<<i<<' ',cnt++,r=a[i],a[i]=-1;
		cout<<endl;
	}
	return 0;
}
